package com.cimr.comm.controller.manager;

import com.cimr.comm.aop.FullPage;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by liqi on 2017/11/30.
 * liqiwork@qq.com
 */
@Controller
@RequestMapping("/manager")
public class ManagerController {
    /**
     * 用户管理
     * @param request
     * @return
     */
//    @RequiresPermissions("manager_userManager")
    @FullPage(menu = "manager_userManager")
    @RequestMapping({"userManager","nav/userManager"})
    public ModelAndView userManager(HttpServletRequest request) {
        return new ModelAndView("comm/manager/userManager");
    }

    /**
     * 角色管理
     * @param request
     * @return
     */
//    @RequiresPermissions("manager_roleManager")
    @FullPage(menu = "manager_roleManager")
    @RequestMapping({"roleManager", "nav/roleManager"})
    public ModelAndView roleManager(HttpServletRequest request) {
        return new ModelAndView("comm/manager/roleManager");
    }
//    @RequiresPermissions("manager_menuManager")
    @FullPage(menu = "manager_menuManager")
    @RequestMapping({"menuManager","nav/menuManager"})
    public ModelAndView menuManager(HttpServletRequest request) {
        return new ModelAndView("comm/manager/menuManager");
    }

//    @RequiresPermissions("manager_operationManager")
    @FullPage(menu = "manager_operationManager")
    @RequestMapping({"operationManager","nav/operationManager"})
    public ModelAndView operationManager(HttpServletRequest request) {
        return new ModelAndView("comm/manager/operationManager");
    }

    /**
     * 权限管理
     * @param request
     * @return
     */
//    @RequiresPermissions("manager_permissionManager")
    @FullPage(menu = "manager_permissionManager")
    @RequestMapping({"nav/permissionManager"})
    public ModelAndView permissionManager(HttpServletRequest request) {
        return new ModelAndView("comm/manager/permissionManager");
    }

    /**
     * 组织管理
     * @param request
     * @return
     */
//    @RequiresPermissions("manager_groupManager")
    @FullPage(menu = "manager_groupManager")
    @RequestMapping({"groupManager","nav/groupManager"})
    public ModelAndView groupManager(HttpServletRequest request) {
        return new ModelAndView("comm/manager/groupManager");
    }

    /**
     * 修改密码
     * @param request
     * @return
     */
    @FullPage(menu = "manager_modifyPassword")
    @RequestMapping({"modifyPassword","nav/modifyPassword"})
    public ModelAndView modifyPassword(HttpServletRequest request) {
        return new ModelAndView("comm/manager/modifyPassword");
    }
}
